<html>
    <head>
        <title></title>
        <meta http-equiv="X-UA-Compatible" content="IE=9" />
        <?php include "jquery.php"; ?>
        <link href="style3.css" rel="stylesheet" type="text/css" />
       
    </head>
    <?php
    $con = mysql_connect('localhost', 'root', '');
    mysql_select_db("mydb");
    session_start();
    $member_id = $_SESSION['member_id'];
    $confID = $_POST['conference'];

//get the authors for a given conference
    $query1 = "SELECT M.first_name, M.last_name, M.member_id
          FROM member M INNER JOIN member_privileges MP
          ON M.member_id = MP.member_id
          INNER JOIN privileges Pr
          ON MP.privileges_id = Pr.privileges_id
          WHERE MP.conference_id = $confID
          AND Pr.role = 'author'
          AND M.member_id <> {$member_id}";
//get the reviewers of a given conference
    $query2 = "SELECT M.first_name, M.last_name, M.member_id
           FROM member M
           INNER JOIN member_privileges MP
           ON M.member_id = MP.member_id
           INNER JOIN privileges Pr
           ON MP.privileges_id = Pr.privileges_id
           WHERE MP.conference_id = $confID
           AND Pr.role = 'reviewer'
           AND M.member_id <> {$member_id}";


    echo "<form name='fRadio' method='POST' action='send.php?conference={$confID}'>";
    echo "<fieldset>";
    echo "<legend>Create new message</legend>";
//populates the authors table with authors of this conference
    $authors = mysql_query($query1) or die(mysql_error());
    if ($authors) {
        echo '<p class="flip1">Choose Authors</p>';
        echo "<div class='panel1'>";
        print "<table width=100%; border=1>\n";
        print "<tr>\n";

        print "<th>&nbsp; </th>\n";
        print "<th><width=\"0%\" height=\"0\" style=\"display:none\" value=\"Member ID\"</th>\n";
        print "<th> Author Name </th>\n";

        print "</tr>\n";
        //create table
        $i = 0;
        while ($row = mysql_fetch_array($authors)) {
            $i++;
            print "<tr>\n";
            print "<td><input type=\"checkbox\" name=\"authors[]\" value=\"$row[member_id]\"></td>\n";
            echo "<td><width=\"0%\" height=\"0\" style=\"display:none\" value=\"{$row['member_id']}\"</td>\n";
            echo "<td>{$row['first_name']} {$row['last_name']}</td>\n";

            echo "</tr>\n";
        }//end while
        print "</table>\n";
        echo '</div>';

//populates the reviewers table with reviewers of this conference
        $reviewers = mysql_query($query2) or die(mysql_error());
        if ($reviewers) {
            echo '<p class="flip2">Choose Reviewers</p>';
            echo "<div class='panel2'>";
            print "<table width=100%; border=1>\n";
            print "<tr>\n";
            print "<th>&nbsp; </th>\n";
            print "<th><width=\"0%\" height=\"0\" style=\"display:none\" value=\"Member ID\"</th>\n";
            print "<th> Reviewer Name </th>\n";

            print "</tr>\n";
            //create table
            $i = 0;
            while ($row = mysql_fetch_array($reviewers)) {
                $i++;
                print "<tr>\n";
                print "<td><input type=\"checkbox\" name=\"reviewers[]\" value=\"$row[member_id]\"></td>\n";
                echo "<td><width=\"0%\" height=\"0\" style=\"display:none\" value=\"{$row['member_id']}\"</td>\n";
                echo "<td>{$row['first_name']} {$row['last_name']}</td>\n";

                echo "</tr>\n";
            }//end while
            print "</table>\n";
            echo '</div>';
        }
    }
    mysql_close($con);
    ?>



    <p align="left">Subject:<input name="subject" value="" type="text"></p>
    <input name="dOption" value="N" onClick="activateThankYou()" type="radio"> Thank You Template<br/>
    <input name="dOption" value="T" onClick="activateReminder()" type="radio"> Reminder Template<br/>
    <input name="dOption" value="T" onClick="activateEmpty()" type="radio"> Empty Template<br/>
    <textarea name="TextBox" rows="5" cols="40" disabled="disabled" type="text" value=""></textarea><br/>
    <input name="Message" value="Send" disabled="disabled" type="submit" >
</fieldset>
</form>
</body>
</html>
<head>
    <script src="sysJavascript.js" language="javascript">
    </script>
</head>


